import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

@Injectable()
export class AppService {
  constructor(private configService: ConfigService) {}

  getHello(): string {
    const appName = this.configService.get<string>('app.name', 'Nest AI Tools');
    const environment = process.env.NODE_ENV || 'development';
    return `Hello from ${appName} running in ${environment} environment!`;
  }

  getConfig(): Record<string, any> {
    return {
      app: {
        name: this.configService.get<string>('app.name', 'Nest AI Tools'),
        port: this.configService.get<number>('PORT', 3000),
      },
      ai: {
        anthropic: {
          apiKey: this.configService.get<string>('ANTHROPIC_API_KEY'),
          apiUrl: this.configService.get<string>('ANTHROPIC_API_URL'),
        },
        openrouter: {
          apiKey: this.configService.get<string>('OPENROUTER_API_KEY'),
          apiUrl: this.configService.get<string>('OPENROUTER_API_URL'),
        },
        deepseek: {
          apiKey: this.configService.get<string>('DEEPSEEK_API_KEY'),
          apiUrl: this.configService.get<string>('DEEPSEEK_API_URL'),
        },
      },
    };
  }
}
